import request from '@/utils/request'

// 查询服务项列表
export function listServiceItem(query) {
  return request({
    url: '/business/serviceItem/list',
    method: 'get',
    params: query
  })
}

// 查询服务项详细
export function getServiceItem(id) {
  return request({
    url: '/business/serviceItem/' + id,
    method: 'get'
  })
}

// 新增服务项
export function addServiceItem(data) {
  return request({
    url: '/business/serviceItem',
    method: 'post',
    data: data
  })
}

// 修改服务项
export function updateServiceItem(data) {
  return request({
    url: '/business/serviceItem',
    method: 'put',
    data: data
  })
}

// 删除服务项
export function delServiceItem(id) {
  return request({
    url: '/business/serviceItem/' + id,
    method: 'delete'
  })
}
export function saleOnHandle(id) {
  return request({
    url: '/business/serviceItem/' + id,
    method: 'patch',
    headers:{
      'cmd': 'on'
    }
  })
}
export function saleDownHandle(id) {
  return request({
    url: '/business/serviceItem/' + id,
    method: 'patch',
    headers:{
      'cmd': 'down'
    }
  })
}

export function getServiceItemList(query) {
  return request({
    url: '/business/serviceItem/list',
    method: "get",
    headers: { 'cmd': 'list' },
    params: query
  })
}
//打开审核框的数据
export function getstartAuditInfo(id) {
  return request({
    url: '/business/serviceItem/'+id +'/auditInfo',
    method: "get",
  })
}
//发起审核 
export function startAudit(data) {
  return request({
    url: '/business/serviceItem/startAudit',
    method: "post",
    data:data
  })
}